
<!-- saved from url=(0086)http://www.java2s.com/Tutorial/CSharp/0560__ADO.Net/OdbcConnectionforAccessmdbfile.htm -->
<HTML><STYLE>#gview-cmenu {
  position: absolute;
  border: 1px solid #ccc;
  background: #fff;
  margin: 0;
  padding: 0;
  top: 0;
  left: 0;
  z-index: 10000;
  list-style-type: none;
  -webkit-box-shadow: 0 3px 5px rgba(0, 0, 0, .5);
}

#gview-cmenu:focus {
  outline: none;
}

.gview-cmenu-item {
  margin: 0;
  padding: 5px 7px;
  cursor: default;
  font-size: 13px;
  font-family: arial, san-serif;
  color: #000;
  -webkit-user-select: none;
}

.gview-cmenu-item:hover {
  background-color: #F0F7F9;
}

.gview-cmenu-item:first-child {
  border-bottom: 1px solid #ddd;
}

.gview-hidden {
  display: none;
}
</STYLE><HEAD><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><TITLE> OdbcConnection for Access mdb file : OdbcConnection&nbsp;«&nbsp;ADO.Net&nbsp;«&nbsp;C# / CSharp Tutorial </TITLE><META http-equiv="content-style-type" content="text/css"><META name="author" content="Demo Source and Support Ltd."><META name="copyright" content="2006 Demo Source and Support Ltd."><META name="description" content=" OdbcConnection for Access mdb file : OdbcConnection&nbsp;&laquo;&nbsp;ADO.Net&nbsp;&laquo;&nbsp;C# / CSharp Tutorial "><META name="keywords" content=" OdbcConnection for Access mdb file : OdbcConnection&nbsp;&laquo;&nbsp;ADO.Net&nbsp;&laquo;&nbsp;C# / CSharp Tutorial "><LINK href="./OdbcConnection for Access mdb file   OdbcConnection « ADO.Net « C#   CSharp Tutorial_files/java2s.css" type="text/css" rel="stylesheet"><LINK rel="shortcut icon" href="http://www.java2s.com/style/favicon.ico"></HEAD><BODY><H1>OdbcConnection for Access mdb file : OdbcConnection&nbsp;«&nbsp;ADO.Net&nbsp;«&nbsp;C# / CSharp Tutorial</H1><TABLE width="1024" border="0"><TBODY><TR align="left"><TD width="140" valign="top" align="left">
<TABLE cellpadding="0" cellspacing="0" class="leftBarTable"><TBODY><TR><TD class="leftLangCell"><A href="http://www.java2s.com/">Home</A></TD></TR>

<TR><TD><A href="http://www.java2s.com/Tutorial/CSharp/CatalogCSharp.htm">C# / CSharp Tutorial</A></TD></TR>

<TR><TD><TABLE class="leftBarFolderTable"><TBODY><TR><TD valign="top">1.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0020__Language-Basics/Catalog0020__Language-Basics.htm">Language Basics</A></TD></TR>
<TR><TD valign="top">2.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0040__Data-Type/Catalog0040__Data-Type.htm">Data Type</A></TD></TR>
<TR><TD valign="top">3.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0060__Operator/Catalog0060__Operator.htm">Operator</A></TD></TR>
<TR><TD valign="top">4.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0080__Statement/Catalog0080__Statement.htm">Statement</A></TD></TR>
<TR><TD valign="top">5.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0100__String/Catalog0100__String.htm">String</A></TD></TR>
<TR><TD valign="top">6.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0120__struct/Catalog0120__struct.htm">struct</A></TD></TR>
<TR><TD valign="top">7.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0140__Class/Catalog0140__Class.htm">Class</A></TD></TR>
<TR><TD valign="top">8.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0160__Operator-Overload/Catalog0160__Operator-Overload.htm">Operator Overload</A></TD></TR>
<TR><TD valign="top">9.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0180__delegate/Catalog0180__delegate.htm">delegate</A></TD></TR>
<TR><TD valign="top">10.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0200__Attribute/Catalog0200__Attribute.htm">Attribute</A></TD></TR>
<TR><TD valign="top">11.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0220__Data-Structure/Catalog0220__Data-Structure.htm">Data Structure</A></TD></TR>
<TR><TD valign="top">12.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0240__Assembly/Catalog0240__Assembly.htm">Assembly</A></TD></TR>
<TR><TD valign="top">13.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0260__Date-Time/Catalog0260__Date-Time.htm">Date Time</A></TD></TR>
<TR><TD valign="top">14.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0280__Development/Catalog0280__Development.htm">Development</A></TD></TR>
<TR><TD valign="top">15.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0300__File-Directory-Stream/Catalog0300__File-Directory-Stream.htm">File Directory Stream</A></TD></TR>
<TR><TD valign="top">16.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0340__Preprocessing-Directives/Catalog0340__Preprocessing-Directives.htm">Preprocessing Directives</A></TD></TR>
<TR><TD valign="top">17.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0360__Regular-Expression/Catalog0360__Regular-Expression.htm">Regular Expression</A></TD></TR>
<TR><TD valign="top">18.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0380__Generic/Catalog0380__Generic.htm">Generic</A></TD></TR>
<TR><TD valign="top">19.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0400__Reflection/Catalog0400__Reflection.htm">Reflection</A></TD></TR>
<TR><TD valign="top">20.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0420__Thread/Catalog0420__Thread.htm">Thread</A></TD></TR>
<TR><TD valign="top">21.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0440__I18N-Internationalization/Catalog0440__I18N-Internationalization.htm">I18N Internationalization</A></TD></TR>
<TR><TD valign="top">22.</TD><TD class="leftNewFolderCell"><A href="http://www.java2s.com/Tutorial/CSharp/0450__LINQ/Catalog0450__LINQ.htm">LINQ</A></TD></TR>
<TR><TD valign="top">23.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0460__GUI-Windows-Forms/Catalog0460__GUI-Windows-Forms.htm">GUI Windows Forms</A></TD></TR>
<TR><TD valign="top">24.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0480__2D/Catalog0480__2D.htm">2D</A></TD></TR>
<TR><TD valign="top">25.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0500__Design-Patterns/Catalog0500__Design-Patterns.htm">Design Patterns</A></TD></TR>
<TR><TD valign="top">26.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0520__Windows/Catalog0520__Windows.htm">Windows</A></TD></TR>
<TR><TD valign="top">27.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0540__XML/Catalog0540__XML.htm">XML</A></TD></TR>
<TR><TD valign="top">28.</TD><TD class="leftNewFolderCell"><A href="http://www.java2s.com/Tutorial/CSharp/0541__XML-LINQ/Catalog0541__XML-LINQ.htm">XML LINQ</A></TD></TR>
<TR><TD valign="top">29.</TD><TD><B>ADO.Net</B></TD></TR>
<TR><TD valign="top">30.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0580__Network/Catalog0580__Network.htm">Network</A></TD></TR>
<TR><TD valign="top">31.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0581__Directory-Services/Catalog0581__Directory-Services.htm">Directory Services</A></TD></TR>
<TR><TD valign="top">32.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0600__Security/Catalog0600__Security.htm">Security</A></TD></TR>
<TR><TD valign="top">33.</TD><TD><A href="http://www.java2s.com/Tutorial/CSharp/0620__unsafe/Catalog0620__unsafe.htm">unsafe</A></TD></TR>
</TBODY></TABLE></TD></TR><TR><TD class="leftLangCell"><A href="http://www.java2s.com/Code/CSharp/CatalogCSharp.htm">C# / C Sharp</A></TD></TR>
<TR><TD class="leftNewLangCell"><A href="http://www.java2s.com/Code/CSharpAPI/CatalogCSharpAPI.htm">C# / C Sharp by API</A></TD></TR>
<TR><TD class="leftLangCell"><A href="http://www.java2s.com/Open-Source/CSharp/CatalogCSharp.htm">C# / CSharp Open Source</A></TD></TR>
</TBODY></TABLE></TD><TD width="2px"><TD valign="top"><SCRIPT language="javascript" src="./OdbcConnection for Access mdb file   OdbcConnection « ADO.Net « C#   CSharp Tutorial_files/get.media"></SCRIPT><A href="http://www.boostup.org/" target="_blank"><IMG width="728" height="90" src="./OdbcConnection for Access mdb file   OdbcConnection « ADO.Net « C#   CSharp Tutorial_files/adc_boost_amare_728x90.jpg" border="0"></A>
<NOSCRIPT></NOSCRIPT><TABLE border="0"><TBODY><TR><TD height="3"></TR></TBODY></TABLE>
<TABLE class="googleBar" width="800" cellspacing="0" cellpadding="0" border="0"><TBODY><TR><TD width="60%"><A href="http://www.java2s.com/Tutorial/CSharp/CatalogCSharp.htm">C# / CSharp Tutorial</A>&nbsp;»&nbsp;<A href="http://www.java2s.com/Tutorial/CSharp/0560__ADO.Net/Catalog0560__ADO.Net.htm">ADO.Net</A>&nbsp;»&nbsp;<A href="http://www.java2s.com/Tutorial/CSharp/0560__ADO.Net/0860__OdbcConnection.htm">OdbcConnection</A></TD><TD align="right" width="10%">&nbsp;</TD><TD align="right" height="80%" width="30%"><FORM action="http://www.google.com/cse" id="cse-search-box"><DIV><INPUT type="hidden" name="cx" value="partner-pub-1130008796007602:iri8be-v211"><INPUT type="hidden" name="ie" value="ISO-8859-1"><INPUT type="text" name="q" size="15" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(126, 157, 185); border-right-color: rgb(126, 157, 185); border-bottom-color: rgb(126, 157, 185); border-left-color: rgb(126, 157, 185); padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; background-image: url(http://www.google.com/cse/intl/en/images/google_custom_search_watermark.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: 0% 50%; background-repeat: no-repeat no-repeat; "><INPUT type="submit" name="sa" value="Search"></DIV><INPUT name="siteurl" type="hidden" value="www.java2s.com/Tutorial/CSharp/0560__ADO.Net/OdbcConnectionforAccessmdbfile.htm"></FORM><SCRIPT type="text/javascript" src="./OdbcConnection for Access mdb file   OdbcConnection « ADO.Net « C#   CSharp Tutorial_files/brand"></SCRIPT></TD> </TR></TBODY></TABLE><TABLE border="0"><TBODY><TR><TD height="3"></TR></TBODY></TABLE>
<TABLE width="650" border="0" cellspacing="0" cellpadding="0"><TBODY>
<TR><TD align="left"><SCRIPT type="text/javascript"><!--
google_ad_client="pub-1130008796007602";google_ad_width=300;google_ad_height=250;google_ad_format="300x250_as";google_ad_type="text_image";google_ad_channel="";google_color_border="ffffff";google_color_bg="FFFFFF";google_color_link="003399";google_color_url="75a3ed";google_color_text="000000";
//--></SCRIPT><SCRIPT type="text/javascript" src="./OdbcConnection for Access mdb file   OdbcConnection « ADO.Net « C#   CSharp Tutorial_files/show_ads.js"></SCRIPT><SCRIPT src="./OdbcConnection for Access mdb file   OdbcConnection « ADO.Net « C#   CSharp Tutorial_files/expansion_embed.js"></SCRIPT><SCRIPT src="./OdbcConnection for Access mdb file   OdbcConnection « ADO.Net « C#   CSharp Tutorial_files/test_domain.js"></SCRIPT><SCRIPT>google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad);</SCRIPT><INS style="display:inline-table;border:none;height:250px;margin:0;padding:0;position:relative;visibility:visible;width:300px"><INS style="display:block;border:none;height:250px;margin:0;padding:0;position:relative;visibility:visible;width:300px"><IFRAME allowtransparency="true" frameborder="0" height="250" hspace="0" id="google_ads_frame1" marginheight="0" marginwidth="0" name="google_ads_frame" scrolling="no" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1130008796007602&format=300x250_as&output=html&h=250&w=300&lmt=1268084411&ad_type=text_image&color_bg=FFFFFF&color_border=ffffff&color_link=003399&color_text=000000&color_url=75a3ed&flash=10.0.22&url=http%3A%2F%2Fwww.java2s.com%2FTutorial%2FCSharp%2F0560__ADO.Net%2FOdbcConnectionforAccessmdbfile.htm&dt=1268228669522&correlator=1268228669523&frm=0&ga_vid=753583043.1268228670&ga_sid=1268228670&ga_hid=1161882019&ga_fc=0&u_tz=420&u_his=2&u_java=1&u_h=800&u_w=1280&u_ah=760&u_aw=1280&u_cd=32&u_nplug=10&u_nmime=51&biw=607&bih=628&fu=0&ifi=1&dtd=40&xpc=81YlDhLXAX&p=http%3A//www.java2s.com" style="left:0;position:absolute;top:0" vspace="0" width="300"></IFRAME></INS></INS></TD>
<TD align="right"><SCRIPT type="text/javascript"><!--
google_ad_client="pub-1130008796007602";google_ad_width=300;google_ad_height=250;google_ad_format="300x250_as";google_ad_type="text_image";google_ad_channel="";google_color_border="ffffff";google_color_bg="FFFFFF";google_color_link="003399";google_color_url="75a3ed";google_color_text="000000";
//--></SCRIPT><SCRIPT type="text/javascript" src="./OdbcConnection for Access mdb file   OdbcConnection « ADO.Net « C#   CSharp Tutorial_files/show_ads.js"></SCRIPT><SCRIPT>google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad);</SCRIPT><INS style="display:inline-table;border:none;height:250px;margin:0;padding:0;position:relative;visibility:visible;width:300px"><INS style="display:block;border:none;height:250px;margin:0;padding:0;position:relative;visibility:visible;width:300px"><IFRAME allowtransparency="true" frameborder="0" height="250" hspace="0" id="google_ads_frame2" marginheight="0" marginwidth="0" name="google_ads_frame" scrolling="no" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1130008796007602&format=300x250_as&output=html&h=250&w=300&lmt=1268084411&ad_type=text_image&color_bg=FFFFFF&color_border=ffffff&color_link=003399&color_text=000000&color_url=75a3ed&flash=10.0.22&url=http%3A%2F%2Fwww.java2s.com%2FTutorial%2FCSharp%2F0560__ADO.Net%2FOdbcConnectionforAccessmdbfile.htm&dt=1268228669568&prev_fmts=300x250_as&correlator=1268228669523&frm=0&ga_vid=753583043.1268228670&ga_sid=1268228670&ga_hid=1161882019&ga_fc=0&u_tz=420&u_his=2&u_java=1&u_h=800&u_w=1280&u_ah=760&u_aw=1280&u_cd=32&u_nplug=10&u_nmime=51&biw=607&bih=628&fu=0&ifi=2&dtd=15&xpc=6fblJdlNBk&p=http%3A//www.java2s.com" style="left:0;position:absolute;top:0" vspace="0" width="300"></IFRAME></INS></INS></TD></TR></TBODY>
</TABLE><TABLE width="800" border="0"><TBODY><TR><TD class="codeTitle">29.47.1.OdbcConnection for Access mdb file</TD></TR>
<TR><TD><TABLE border="0"><TBODY><TR><TD height="20"></TR></TBODY></TABLE>
</TD></TR>
<TR><TD><TABLE border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff">
   <TBODY><TR>
<TD nowrap="nowrap" valign="top" align="left"><DIV class="codeShade"><CODE><FONT color="#7f0055"><B>using&nbsp;</B></FONT><FONT color="#000000">System;</FONT><BR>
<FONT color="#7f0055"><B>using&nbsp;</B></FONT><FONT color="#000000">Microsoft.Data.Odbc;</FONT><BR>
<FONT color="#ffffff"></FONT><BR>
<FONT color="#7f0055"><B>class&nbsp;</B></FONT><FONT color="#000000">MainClass</FONT><BR>
<FONT color="#000000">{</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#7f0055"><B>static&nbsp;</B></FONT><FONT color="#7f0055"><B>void&nbsp;</B></FONT><FONT color="#000000">Main</FONT><FONT color="#000000">(</FONT><FONT color="#000000">string</FONT><FONT color="#000000">[]&nbsp;</FONT><FONT color="#000000">args</FONT><FONT color="#000000">)</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">{</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">string&nbsp;connectionString&nbsp;&nbsp;=&nbsp;@</FONT><FONT color="#2a00ff">"Driver={Microsoft&nbsp;Access&nbsp;Driver&nbsp;(*.mdb)};DBQ=c:\Northwind.mdb"</FONT><FONT color="#000000">;</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">string&nbsp;SQL&nbsp;=&nbsp;</FONT><FONT color="#2a00ff">"SELECT&nbsp;*&nbsp;FROM&nbsp;Orders"</FONT><FONT color="#000000">;</FONT><BR>
<FONT color="#ffffff"></FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">OdbcConnection&nbsp;&nbsp;conn&nbsp;=&nbsp;</FONT><FONT color="#7f0055"><B>new&nbsp;</B></FONT><FONT color="#000000">OdbcConnection</FONT><FONT color="#000000">(</FONT><FONT color="#000000">connectionString</FONT><FONT color="#000000">)</FONT><FONT color="#000000">;</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">OdbcCommand&nbsp;cmd&nbsp;=&nbsp;</FONT><FONT color="#7f0055"><B>new&nbsp;</B></FONT><FONT color="#000000">OdbcCommand</FONT><FONT color="#000000">(</FONT><FONT color="#000000">SQL</FONT><FONT color="#000000">)</FONT><FONT color="#000000">;</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">cmd.Connection&nbsp;=&nbsp;conn;</FONT><BR>
<FONT color="#ffffff"></FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">conn.Open</FONT><FONT color="#000000">()</FONT><FONT color="#000000">;</FONT><BR>
<FONT color="#ffffff"></FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">OdbcDataReader&nbsp;reader&nbsp;=&nbsp;cmd.ExecuteReader</FONT><FONT color="#000000">()</FONT><FONT color="#000000">;</FONT><BR>
<FONT color="#ffffff"></FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#7f0055"><B>while&nbsp;</B></FONT><FONT color="#000000">(</FONT><FONT color="#000000">reader.Read</FONT><FONT color="#000000">())&nbsp;</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">{</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">Console.Write</FONT><FONT color="#000000">(</FONT><FONT color="#2a00ff">"OrderID:"</FONT><FONT color="#000000">+reader.GetInt32</FONT><FONT color="#000000">(</FONT><FONT color="#990000">0</FONT><FONT color="#000000">)</FONT><FONT color="#000000">.ToString</FONT><FONT color="#000000">()&nbsp;)</FONT><FONT color="#000000">;</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">Console.Write</FONT><FONT color="#000000">(</FONT><FONT color="#2a00ff">"&nbsp;,"</FONT><FONT color="#000000">)</FONT><FONT color="#000000">;</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">Console.WriteLine</FONT><FONT color="#000000">(</FONT><FONT color="#2a00ff">"Customer:"&nbsp;</FONT><FONT color="#000000">+&nbsp;reader.GetString</FONT><FONT color="#000000">(</FONT><FONT color="#990000">1</FONT><FONT color="#000000">)</FONT><FONT color="#000000">.ToString</FONT><FONT color="#000000">()&nbsp;)</FONT><FONT color="#000000">;</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">}</FONT><BR>
<FONT color="#ffffff"></FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">reader.Close</FONT><FONT color="#000000">()</FONT><FONT color="#000000">;</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">conn.Close</FONT><FONT color="#000000">()</FONT><FONT color="#000000">;</FONT><BR>
<FONT color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#000000">}</FONT><BR>
<FONT color="#000000">}</FONT></CODE></DIV></TD>   </TR>
</TBODY></TABLE>
</TD></TR>
</TBODY></TABLE><TABLE border="0"><TBODY><TR><TD height="20"></TR></TBODY></TABLE>
<TABLE cellpadding="0" cellspacing="0" width="800" border="0"><TBODY><TR><TD colspan="5">29.47.OdbcConnection</TD></TR><TR class="odd"><TD width="20"><TD width="100">29.47.1.</TD><TD align="left">OdbcConnection for Access mdb file</TD><TD width="32"><TD width="200"></TR><TR class="even"><TD width="20"><TD width="100">29.47.2.</TD><TD align="left"><A href="http://www.java2s.com/Tutorial/CSharp/0560__ADO.Net/UseODBCDataProvider.htm">Use ODBC Data Provider</A></TD><TD width="32"><TD width="200"></TR></TBODY></TABLE><TABLE border="0"><TBODY><TR><TD height="10"></TR></TBODY></TABLE>
<SCRIPT type="text/javascript"><!--
google_ad_client="pub-1130008796007602";google_ad_width=728;google_ad_height=90;google_ad_format="728x90_as";google_ad_type="text_image";google_ad_channel="";google_color_border="ffffff";google_color_bg="ffffff";google_color_link="003399";google_color_text="000000";google_color_url="75a3ed";
//--></SCRIPT><SCRIPT type="text/javascript" src="./OdbcConnection for Access mdb file   OdbcConnection « ADO.Net « C#   CSharp Tutorial_files/show_ads.js"></SCRIPT><SCRIPT>google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad);</SCRIPT><INS style="display:inline-table;border:none;height:90px;margin:0;padding:0;position:relative;visibility:visible;width:728px"><INS style="display:block;border:none;height:90px;margin:0;padding:0;position:relative;visibility:visible;width:728px"><IFRAME allowtransparency="true" frameborder="0" height="90" hspace="0" id="google_ads_frame3" marginheight="0" marginwidth="0" name="google_ads_frame" scrolling="no" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1130008796007602&format=728x90_as&output=html&h=90&w=728&lmt=1268084411&ad_type=text_image&color_bg=ffffff&color_border=ffffff&color_link=003399&color_text=000000&color_url=75a3ed&flash=10.0.22&url=http%3A%2F%2Fwww.java2s.com%2FTutorial%2FCSharp%2F0560__ADO.Net%2FOdbcConnectionforAccessmdbfile.htm&dt=1268228669593&prev_fmts=300x250_as%2C300x250_as&correlator=1268228669523&frm=0&ga_vid=753583043.1268228670&ga_sid=1268228670&ga_hid=1161882019&ga_fc=0&u_tz=420&u_his=2&u_java=1&u_h=800&u_w=1280&u_ah=760&u_aw=1280&u_cd=32&u_nplug=10&u_nmime=51&biw=607&bih=628&fu=0&ifi=3&dtd=3&xpc=5vqMby0V0a&p=http%3A//www.java2s.com" style="left:0;position:absolute;top:0" vspace="0" width="728"></IFRAME></INS></INS></TD></TR></TBODY></TABLE><CENTER><TABLE border="0"><TBODY><TR align="left"><TD><A href="http://www.java2s.com/">w_w_w_.__j___a_va___2__s__.c__o___m__</A> | <A href="http://www.java2s.com/html/contact.htm">Contact Us</A></TD></TR><TR align="left"><TD class="Templatetext">Copyright 2009 - 12 Demo Source and Support. All rights reserved.</TD></TR><TR align="left"><TD>All other trademarks are property of their respective owners.</TD></TR></TBODY></TABLE></CENTER>
</BODY></HTML>